#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
    double arr1[5] = { 0 };
    double arr2[5] = { 0 };
    double arr3[5] = { 0 };
    double arr4[5] = { 0 };
    double arr5[5] = { 0 };
    double* arr[5] = { arr1,arr2,arr3,arr4,arr5 };

    for (int z = 0; z < 5; z++)
    {
        for (int i = 0; i < 5; i++)
        {
            scanf("%lf", &arr[z][i]);
        }
    }
    double sum[5] = { 0 };
    for (int z = 0; z < 5; z++)
    {
        for (int i = 0; i < 5; i++)
        {
            sum[z] += arr[z][i];
        }
    }
    for (int z = 0; z < 5; z++)
    {
        for (int i = 0; i < 5; i++)
        {
            if (i == 4)
                printf("%.1lf %.1lf\n", arr[z][i], sum[z]);
            else printf("%.1lf ", arr[z][i]);
        }
    }
    return 0;
}